#include "tcpClient.hpp"
#include <memory>

using namespace client;
using namespace std;

void Usage(const std::string &proc)
{
    std::cerr << "\nUsage:\r\n"
              << proc << " serverip serverport\n\n"
              << std::endl;
}

// ./tcpclient serverip serverport
int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        Usage(argv[0]);
        exit(1);
    }
    std::string serverip = argv[1];
    uint16_t serverport = atoi(argv[2]);

    unique_ptr<tcpClient> tcpclient(new tcpClient(serverip, serverport));
    tcpclient->initClient();
    tcpclient->start();

    return 0;
}